using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using RealState.BusinessObjects;
using RealState.DAL;

namespace RealState.BLL
{
	public class DistrictsBLL
	{
		private DistrictsDAO _DistrictsDAO;

		public DistrictsDAO DistrictsDAO
		{
			get { return _DistrictsDAO; }
			set { _DistrictsDAO = value; }
		}

		public DistrictsBLL()
		{
			DistrictsDAO = new DistrictsDAO();
		}
		public List<Districts> GetDistrictss()
		{
			try
			{
				return DistrictsDAO.GetDistrictss();
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public Districts GetDistricts(int Id)
		{
			try
			{
				return DistrictsDAO.GetDistricts(Id);
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public int AddDistricts(Districts oDistricts)
		{
			try
			{
				return DistrictsDAO.AddDistricts(oDistricts);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateDistricts(Districts oDistricts)
		{
			try
			{
				return DistrictsDAO.UpdateDistricts(oDistricts);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveDistricts(Districts oDistricts)
		{
			try
			{
				return DistrictsDAO.RemoveDistricts(oDistricts);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveDistricts(int Id)
		{
			try
			{
				return DistrictsDAO.RemoveDistricts(Id);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<Districts> DeserializeDistrictss(string Path)
		{
			try
			{
				return GenericXmlSerializer<List<Districts>>.Deserialize(Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public void SerializeDistrictss(string Path, List<Districts> Districtss)
		{
			try
			{
				GenericXmlSerializer<List<Districts>>.Serialize(Districtss, Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}
